import request from '@/utils/request'

export function getDicts() {
  return request({
    url: 'api/dict/all',
    method: 'get'
  })
}

export function add(obj) {
  return request({
    url: 'admin/dict/save',
    method: 'post',
    data:obj
  })
}

export function del(ids) {
  return request({
    url: 'admin/dict/del',
    method: 'post',
    data: ids
  })
}

export function edit(obj) {
  return request({
    url: 'admin/dict/edit',
    method: 'post',
    data:obj
  })
}

/**
 * 字典明细
 */
export function getDetails(obj) {
  return request({
    url: 'admin/dict/detail',
    method: 'post',
    data:obj
  })
}

/**
 * 插入字典项
 */
export function saveDetails(obj) {
  return request({
    url: 'admin/dict/save-details',
    method: 'post',
    data:obj
  })
}

/**
 * 修改字典项
 */
export function editDetails(obj) {
  return request({
    url: 'admin/dict/edit-details',
    method: 'post',
    data:obj
  })
}

/**
 * 删除字典项以及关系
 */
export function delRevo(obj) {
  return request({
    url: 'admin/dict/del-details',
    method: 'post',
    data:obj
  })
}



export default { add, edit, del }
